package xj.model.uml;

import static xj.model.uml.UMLModelConstants.ATTR_TYPE;

public class SequenceNode extends BasicModelElement implements MessageNode {

  public enum SequenceNodeType {
    Receive_Message, Send_Message, Terminate,
  }

  public SequenceNode() {
    this(SequenceNodeType.Receive_Message);
  }

  public SequenceNode(SequenceNodeType type) {
    setType(type);
    destructable = false;
  }

  public SequenceNodeType getType() {
    return type;
  }

  public void setType(SequenceNodeType type) {
    this.type = type;
    setAttribute(ATTR_TYPE, type);
  }

  @Override
  public String toString() {
    return "SequenceNode: type=" + type;
  }

  @Override
  public Object clone() throws CloneNotSupportedException {
    SequenceNode a = (SequenceNode) super.clone();
    a.setType(type);
    return a;
  }

  protected SequenceNodeType type;

}
